package main.flex.connectivity
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import main.flex.connectivity.notification.NetConnectionClientEvent;
	
	public class NetConnectionClient extends EventDispatcher
	{
		public static const ON_USER_ID				:String = "onUserID";
		
		private static var _netConnectionClient		: NetConnectionClient;
		
		private var _uID							: Number;
		
		public static function getInstance( ) 		: NetConnectionClient
		{
			if ( ! _netConnectionClient )
				_netConnectionClient = new NetConnectionClient( );
				return _netConnectionClient;
		}
		
		public function setUserInfo(uID:Number):void
		{
			_uID=uID;
			dispatchEvent(new Event(NetConnectionClient.ON_USER_ID));
		}
		
		public function receiveChatMessage(msg:String):void
		{
			var tempObj:Object = new Object();
			tempObj.msg = msg;
			
			dispatchEvent(new NetConnectionClientEvent("onReceiveChatMsg", tempObj));			
		}
		
		public function getUserId():Number
		{
			return _uID;
		}
	}
}